#include "StdAfx.h"
#include "WEIButton.h"

CWEIButton::CWEIButton(void)
{
	m_pNoramlStyleName[0] = '\0';
	m_pDownStyleName[0] = '\0';
}

CWEIButton::~CWEIButton(void)
{
}

void CWEIButton::SetProperties(PCWceUiXmlElem pCreateElem)
{
	ASSERT(NULL != pCreateElem);
	CWceUiLayer::SetProperties(pCreateElem);

	LPCTSTR pNormalStyleName = pCreateElem->GetAttr(L"style");
	LPCTSTR pDownStyleName = pCreateElem->GetAttr(_T("down.style"));

	if (NULL != pNormalStyleName)
	{
		SetNormalStyleName(pNormalStyleName);
	}

	if (NULL != pDownStyleName)
	{
		SetDownStyleName(pDownStyleName);
	}
}

LRESULT CWEIButton::OnCommand(UINT uCommand, WPARAM wParam, LPARAM lParam)
{

	return 0;
}

LPCTSTR CWEIButton::GetNoramlStyleName() const
{
	return m_pNoramlStyleName;
}

void CWEIButton::SetNormalStyleName(LPCTSTR pNoramlStyleName)
{
	ASSERT(NULL != pNoramlStyleName);

	m_pNoramlStyleName[MAX_TAG_NAME_LEN - 1] = '\0';
	_tcsncpy(m_pNoramlStyleName, pNoramlStyleName, MAX_TAG_NAME_LEN - 1);	
}


LPCTSTR CWEIButton::GetDownStyleName() const
{
	return m_pDownStyleName;
}

void CWEIButton::SetDownStyleName(LPCTSTR pDownStyleName)
{
	ASSERT(NULL != pDownStyleName);

	m_pDownStyleName[MAX_TAG_NAME_LEN - 1] = '\0';
	_tcsncpy(m_pDownStyleName, pDownStyleName, MAX_TAG_NAME_LEN - 1);
}